import { defineComponent } from 'vue';

const Title = defineComponent({
  setup() {
    return () => <h1>title test</h1>;
  },
});

const Ac = defineComponent({
  props: {},
  setup(_props, { slots }) {
    return () => (
      <div class="title">
        {slots.title && slots.title()} {/* 渲染 title 插槽 */}
      </div>
    );
  },
});

const Ab = defineComponent({
  props: {
    title: Object, // 定义 title 属性
  },
  setup(props) {
    return () => <Ac v-slots={{ title: () => props.title }} />;
  },
});

const A = defineComponent({
  setup() {
    const TitleComponent = Title;

    return () => <Ab title={<TitleComponent />} />;
  },
});

export default A;
